var scriptName = "AuraHelper";
var scriptAuthor = "FunkNight";
var scriptVersion = 2.0;
var AuraHelperModule = new AuraHelperModule();
var Client;
var KillAura = moduleManager.getModule("KillAura")

var up = 0;
var upp = 0;
var down = 0;
var yawA = 0;
var Attacking = 0;

function AuraHelperModule() {
	var Mode = value.createList("Mode", ["Random", "Push", "AfterHit"], "Random");
	this.getName = function(){
		return "AuraHelper";
	}
	
	this.getDescription = function() {
		return "Help your Aura Rotate";
	}
	this.getCategory = function() {
		return "Misc";
	}
	this.getTag = function() {
		return Mode.get() + '';
	}
	this.onEnable = function(){
		yawA = mc.thePlayer.rotationYawHead;
	}
	this.onUpdate = function(){
		Attacking--;
		switch (Mode.get()) {
			case "Random":
				mc.thePlayer.renderYawOffset = randomNum(0,720);
				mc.thePlayer.rotationYawHead = 80;
				mc.thePlayer.limbSwingAmount = randomNum(0,100);
				function randomNum(minNum,maxNum){ 
				    switch(arguments.length){ 
				        case 1: 
				            return parseInt(Math.random()*minNum+1,10); 
				        break; 
				        case 2: 
				            return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); 
				        break; 
				            default: 
				                return 0; 
				            break; 
				    } 
				}
			break;
			case "Push":
				if(yawA > 100){
					upp = 1;
				}
				if(yawA < 60){
					upp = 0;
				}
				if(yawA > 60){
					if(upp = 0){
						up++;
						down = 0;
					}
				}
				if(yawA < 100){
					if(upp = 1){
						down++;
						up = 0;
					}
				}
				yawA = yawA + up - down;
				mc.thePlayer.rotationYawHead = yawA;
			break;
			case "AfterHit":
				if(Attacking > 60){
					mc.thePlayer.renderYawOffset = randomNum(0,720);
					mc.thePlayer.rotationYawHead = 80;
					mc.thePlayer.limbSwingAmount = randomNum(0,100);
					function randomNum(minNum,maxNum){ 
					    switch(arguments.length){ 
					        case 1: 
					            return parseInt(Math.random()*minNum+1,10); 
					        break; 
					        case 2: 
					            return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); 
					        break; 
					            default: 
					                return 0; 
					            break; 
					    } 
				}
				}
			break;
		}
	}
	this.onAttack = function (event) {
		Attacking = 100;
	}
	this.addValues = function(values) {
	    values.add(Mode);
	}
}
function onEnable() {
    Client = moduleManager.registerModule(AuraHelperModule);
}
	
function onDisable() {
    moduleManager.unregisterModule(Client);
	}